package com.hutao.example.wardemo;

import com.google.gson.Gson;
import com.hutao.example.wardemo.bean.User;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import java.util.ArrayList;
import java.util.List;

//@WebServlet(value = "/internal/startup", loadOnStartup = 1)
//初始化文件 value 也不可以为空 否则不能启动 所以这个值是保证程序可以正常启动
public class Startup extends HttpServlet {

    @Override
    public void init() throws ServletException {
        super.init();
        System.out.println("~~~ was初始化配置 ~~~~");

        User user = new User();
        user.setUsername("hutao");
        user.setAge(18);
        user.setAddress("北京");

        List<User> userList = new ArrayList<User>();
        userList.add(user);
        System.out.println("gson:" + new Gson().toJson(userList));


    }


}
